import { getVegetableData } from '../l.js'
import puppeteer from "../../../lib/puppeteer/puppeteer.js";

export class Fs extends plugin {
    constructor() {
        super({
            name: '[Fs]蔬菜列表',
            dsc: '蔬菜列表',
            event: 'message',
            priority: 1,
            rule: [
                { reg: /^(#|\/)?蔬菜列表$/, fnc: 'vegetableList' }
            ]
        })
    }
    async vegetableList(e) {
        const VEGETABLE_DATA = await getVegetableData()
        const image = await puppeteer.screenshot('蔬菜列表', {
            tplFile: 'plugins/Farming-Simulator/resources/html/vegetableList.html',
            info: VEGETABLE_DATA,
        })
        return e.reply([image])
    }
}